using System.Collections.Generic;
using System.Linq;
using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
namespace SuperPolarity
{
class Widget
{
- public IList<Widget> Children;
+ public List<Widget> Children;
public Dictionary<string, List<Action<float>>> Listeners;
+ public Vector2 Position;
+ public SuperPolarity Game;
+
+ protected bool Active;
+
+ public Widget(SuperPolarity game, Vector2 position)
+ {
+ Game = game;
+ Position = position;
+ Active = false;
+ Children = new List<Widget>();
+ Listeners = new Dictionary<string, List<Action<float>>>();
+ }
+
+ public void Activate()
+ {
+ Active = true;
+ }
+
+ public void Deactivate()
+ {
+ Active = false;
+ }
+
public virtual void AppendChild(Widget widget)
{
Children.Add(widget);
method(value);
}
}
+
+ public virtual void Update(GameTime gameTime)
+ {
+ }
+
+ public virtual void Draw(SpriteBatch spriteBatch)
+ {
+ }
}
}